import { http } from "@/utils/http";
import { getConfig } from "@/config";
import httpConfig from "@/utils/http/httpConfig";

// 部门列表
export function deptLists(params?: any) {
  return http.request<any>("get", httpConfig.system + "/dept/list", { params });
}
/**
 * 获取部门列表 树形
 * @param params
 * @returns
 */
export function deptListTree(params?: any) {
  return http.request<any>("get", httpConfig.system + "/dept/listTree", {
    params
  });
}

export function depttreeselect(params?: any) {
  return http.request<any>("get", httpConfig.system + "/dept/treeselect", {
    params
  });
}

// 添加部门
export function deptAdd(params: any) {
  return http.request<any>("post", httpConfig.system + "/dept", {
    data: params
  });
}

// 编辑部门
export function deptEdit(params: any) {
  return http.request<any>("post", httpConfig.system + "/dept/edit", {
    data: params
  });
}

// 删除部门
export function deptDelete(params: any) {
  return http.request<any>("post", httpConfig.system + "/dept/del/" + params);
}

// 部门详情
export function deptDetail(params?: any) {
  return http.request<any>("get", httpConfig.system + "/dept/" + params);
}
